package org.demo.patten.composite;

/**
 * @author zhuj
 * @date 2025/3/22
 * @apiNote
 * 组合模式
 */
public class Client {
    public static void main(String[] args) {
        Folder root = new Folder("根目录");
        File fileA = new File("A.txt");
        Folder subFolder = new Folder("子文件夹");
        File fileB = new File("B.txt");
        subFolder.add(fileB);
        root.add(fileA);
        root.add(subFolder);
        root.show();
        System.out.println(root.toString());
    }
}
